![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@oada/types
Advanced tools
This package is TypeScript type definitions for known OADA formats. These types are based on OADA/formats.
yarn add @oada/types
The type definition for a given format can be imported based on its $id
.
For example, the OADA Bookmarks v1 format can be imported like so:
/**
* Import the type definition for
* {@link https://formats.openag.io/oada/bookmarks/v1.schema.json}
*/
import Bookmarks from '@oada/types/oada/bookmarks/v1';
Since the formats are backed by schemas, it is possible to check data against a format at runtime. All the types in this package export methods for doing so which are typed properly for TypeScript to understand their type implications.
/**
* Every type also exports both @method is and @method assert
*/
import Bookmarks, {is, assert} from '@oada/types/oada/bookmarks/v1'
const data1: any = /* Some data */
// True if data matches type Bookmarks, false if not
if (is(data1)) {
// TS understands data is a bookmarks here
const bookmarks: Bookmarks = data1
}
const data2: any = /* Some data */
// Throws if data is not of type Bookmarks
assert(data2)
// TS understands data is a bookmarks here
const bookmarks: Bookmarks = data2
FAQs
TypeScript type definitions for OADA formats
The npm package @oada/types receives a total of 25 weekly downloads. As such, @oada/types popularity was classified as not popular.
We found that @oada/types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.